<template>
  <div class="logs">
    <el-radio-group v-model="radio" @change="handleClickImage" size="mini">
      <el-radio-button
        :label="item.label"
        v-for="item in list"
        :key="item.label"
        >{{ item.value }}</el-radio-button
      >
    </el-radio-group>
    <div class="logs-list" v-if="logs.length">
      <div v-for="(item, index) in logs" :key="index">
        {{ item.createtime }}
        {{ item.content }}
      </div>
    </div>
    <div v-else style="margin-top: 10px">暂无数据</div>
  </div>
</template>

<script>
import { postAdminOperateGetLogList } from "@/api";
export default {
  props: {
    id: "",
  },
  data() {
    return {
      list: [
        {
          label: "1",
          value: "运营",
        },
        {
          label: "2",
          value: "营销",
        },
        {
          label: "3",
          value: "生产",
        },
        {
          label: "4",
          value: "设计",
        },
        {
          label: "5",
          value: "板房尺寸",
        },
        {
          label: "6",
          value: "板房工艺单",
        },
        {
          label: "7",
          value: "封样报告",
        },
        {
          label: "8",
          value: "技术文件",
        },
      ],
      radio: "1",
      logs: [],
    };
  },
  mounted() {
    this.handleClickImage(1);
  },
  methods: {
    async handleClickImage(groups) {
      let obj = {
        id: this.id,
        groups: groups,
      };
      let res = await postAdminOperateGetLogList(obj);
      this.logs = res.data;
    },
  },
};
</script>

<style lang="scss" scoped>
.logs {
  padding: 10px;
  .logs-list{
    font-size: 14px;
    margin-left: 10px;
    >div{
        margin-top: 10px;
    }
  }
}
</style>